#ifndef QTWORLD_H
#define QTWORLD_H


#include <QGraphicsScene>
#include "World.h"
#include "QtBoard.h"
#include "QtTileManager.h"
#include "QtAnimationLog.h"

class QtWorld: public QGraphicsScene, public World
{
	Q_OBJECT

public:
	QtWorld();
	virtual ~QtWorld();

	virtual Wall* CreateWall(const Direction& direction, unsigned int cellX, unsigned int cellY);
	virtual Pusher* CreatePusher(const Direction& direction, unsigned int cellX, unsigned int cellY);
	virtual Laser* CreateLaser(const Direction& direction, unsigned int cellX, unsigned int cellY);
	virtual Robot* CreateRobot(const std::string& type, unsigned int cellX, unsigned int cellY);
	virtual Spinner* CreateSpinner(const Direction& direction, unsigned int cellX, unsigned int cellY);



	virtual void BeginBehaviorSimulation();
	virtual void EndBehaviorSimulation();

	void Play();

protected:
	virtual Board* CreateBoard();
private slots:
	void OnAnimationFinished();
	void OnAnimationStarted();
signals:
	void LogFinished();

private:
	QtTileManager tileManager;

	QtAnimationLog animationLog;
	unsigned int animations;

	static const unsigned int CELLSIZE = 64;
};

#endif //QTWORLD_H
